package cn.xuchunh.campusbbs.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import cn.xuchunh.campusbbs.R;
import cn.xuchunh.campusbbs.base.BaseRecyclerViewAdapter;
import cn.xuchunh.campusbbs.bean.Indicator;
import cn.xuchunh.campusbbs.viewholder.SimpleIconViewHolder;

/**
 * Created by XuChunH on 2015/10/4.
 */
public class SimpleIndicatorAdapter extends BaseRecyclerViewAdapter<SimpleIconViewHolder, Indicator> {
    public SimpleIndicatorAdapter(Context context) {
        super(context);
    }

    @Override
    public SimpleIconViewHolder onCreateContentViewHolder(ViewGroup parent, int viewType) {
        return new SimpleIconViewHolder(inflater.inflate(R.layout.item_simple_icon, parent, false));
    }

    @Override
    protected void onBindContentViewHolder(SimpleIconViewHolder holder, int position) {
        Indicator indicator = getDataList().get(position);
        if (indicator != null) {
            holder.icon.setImageURI(indicator.getUri());
            holder.title.setText(indicator.getTitle());
        }
    }

}
